﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using Might.Infrastructure.DOM;

namespace Might.Infrastructure.Annotations.Graphics {
    /// <summary>
    /// Represents graphics annotation for modelica icon which is compatabile with Editor data interface.
    /// </summary>
    public interface IGraphicsAnnotation : IDomNode {

        /// <summary>
        /// Inherited graphics annotation for given Container type.
        /// </summary>
        /// <value>list of inherited Graphics Annotations.</value>
        List<IGraphicsAnnotation> InheritedGraphics { get; }
        
        /// <summary>
        /// Current graphics annotation for given Container type.
        /// </summary>
        /// <value>List of graphical entities.</value>
        ObservableCollection<IGraphicsItem> Graphics { get; }
        
        /// <summary>
        /// Gets the <see cref="IGraphicsItem"/> at the specified index.
        /// </summary>
        /// <value></value>
        IGraphicsItem this[int index] { get; }

        /// <summary>
        /// Adds new primitive to this layer.
        /// </summary>
        /// <param name="primitive">The primitive.</param>
        void AddPrimitive(IGraphicsItem primitive);

        /// <summary>
        /// Removes the primitive from this layer.
        /// </summary>
        /// <param name="primitive">The primitive.</param>
        void RemovePrimitive(IGraphicsItem primitive);


        /// <summary>
        /// Brings primitives to the front (last index in the list)
        /// </summary>
        /// <param name="list">The primitive.</param>
        void BringToFront(List<IGraphicsItem> list);

        /// <summary>
        /// Brings primitives the forward - next higher index in the list.
        /// </summary>
        /// <param name="list">The primitive.</param>
        void BringForward(List<IGraphicsItem> list);

        /// <summary>
        /// Sends primitives to back (first primitive in the list)
        /// </summary>
        /// <param name="list">The primitive.</param>
        void SendToBack(List<IGraphicsItem> list);

        /// <summary>
        /// Sends primitives backward - next lower index in the list.
        /// </summary>
        /// <param name="list">The primitive.</param>
        void SendBackward(List<IGraphicsItem> list);

        /// <summary>
        /// Call when more primitives of this layer are selected.
        /// </summary>
        void MultipleSelect(List<IGraphicsItem> primitives);

        /// <summary>
        /// Call when multiple selection in graphics editor are changed (position, size,...etc).
        /// </summary>
        void MultipleChanged();
    }
}